package com.drojian.demo1.root_fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo1.test2.RatingBarActivity;
import com.drojian.demo1.test5.AlertDiaLogActivity;
import com.drojian.demo1.test5.BottomSheetDialogActivity;
import com.drojian.demo1.test5.PopupWindowActivity;
import com.drojian.demo1.test5.ToastActivity;


public class RootFragment5 extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.ui1_fragment_root5, container, false);

        Button toast1 = view.findViewById(R.id.Toast1);
        Button alertDialog1 = view.findViewById(R.id.AlertDialog1);
        Button dialog1 = view.findViewById(R.id.Dialog1);
        Button bottomSheetDialog1 = view.findViewById(R.id.BottomSheetDialog1);
        Button popWindow1 = view.findViewById(R.id.PopWindow1);


        toast1.setOnClickListener(v -> startActivity(new Intent(getContext(), ToastActivity.class)));
        alertDialog1.setOnClickListener(v -> startActivity(new Intent(getContext(), AlertDiaLogActivity.class)));
        dialog1.setOnClickListener(v -> startActivity(new Intent(getContext(), RatingBarActivity.class)));
        bottomSheetDialog1.setOnClickListener(v -> startActivity(new Intent(getContext(), BottomSheetDialogActivity.class)));
        popWindow1.setOnClickListener(v -> startActivity(new Intent(getContext(), PopupWindowActivity.class)));
        return view;
    }
    public static RootFragment5 newInstance() {
        return new RootFragment5();
    }
}